﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class student
    {
        private int age;
        public int num;
        public string name;

        public int Age 
        {
            get { return this.age; }
            set {
                if (value<0 || value>100)
                {
                    value = 0;
                }
                this.age = value;}
        }

        public student(int age, int num, string name)
        {
            this.Age = age;
            this.name = name;
            this.num = num;
        }

        public override string ToString()
        {
            return $"我叫{name }，我的年龄是{Age}，我的学号是{num }";
        }

    }
}
